package com.wasion.pwportable.protocol.analyzer.terminal;

import com.wasion.pwportable.protocol.Result;
import com.wasion.pwportable.protocol.analyzer.AbstractAnalyzer;

public class Terminal_Reset_Analyzer extends AbstractAnalyzer {

	@Override
	public void dataAnalysis(String ackBS) {
		String dataType = ackBS.substring(DATATPYESTARTBIT, DATATPYENDBIT);
		// /String dataLen = ackBS.substring(DATALENGTHSTARTBIT,
		// DATALENGTHENDBIT); // 16进制的数据长度
		// int dataLenInt = Integer.parseInt(dataLen, 16); // 转换成10进制的数据长度

		if (dataType.equalsIgnoreCase("D9")) {
			if (ackBS.substring(DATABITSTART, DATABITSTART + 2)
					.equalsIgnoreCase("01"))
				result.setActionReply(Result.SUCCESS);
			else
				result.setActionReply(Result.FAILED);
		} else
			result.setActionReply(Result.NO_REPLY);
	}
}
